package com.yzb.config;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.Max;

/**
 * ftp配置.
 *
 * @version 1.0.0
 * @author huang yu zhi
 * @date 2019-01-25 11:15
 */
@Data
@Component
@Validated
@PropertySource(value = "classpath:ftp.properties", encoding = "utf-8")
@ConfigurationProperties(prefix = "ftp")
public class FtpConfig {
    /**连接超时时间.*/
    private int connectTimeout;
    /**连接端口.*/
    private int port;
    /**服务器编码.*/
    private String serverCharset;
    /**本地编码.*/
    private String localCharset;
    /**每次传输缓存的字节数.*/
    @Max(65536)
    private int bufferSize = 10 * 2014;
    /**每隔百分之几调用一次进度监控器,取值[1-100].*/
    private int intervalProgress = 10;
    /**将缓存字节写入文件的最大缓存大小.*/
    private int flushSize;
}
